//
//  AboutUsViewController.m
//  Civacrm
//
//  Created by zhk on 2017/2/7.
//  Copyright © 2017年 王桂敏. All rights reserved.
//

#import "AboutUsViewController.h"

@interface AboutUsViewController ()

@property (nonatomic , strong) UIImageView * logoImageView;
@property (nonatomic , strong) UILabel * contentLabel;

@end

@implementation AboutUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"关于我们";
    [self initView];
    [self initNetWork];
}


- (void)initNetWork
{
    [self.manager postWithURL:NET_GetAboutUsMessage param:self.params delegate:self isEncrypt:NO type:NetWorkingType0];

}

- (void)networkingHandleSuccess:(NetworkingHandle *)handle parameters:(NSDictionary *)parameters responseObject:(id)responseObject type:(NetWorkingType)type
{
    self.contentLabel.text = responseObject[@"content"];
    
}

- (void)networkingHandleWarning:(NetworkingHandle *)handle responseObject:(id)responseObject type:(NetWorkingType)type
{
    
}

- (void)networkingHandlefail:(NetworkingHandle *)handle type:(NetWorkingType)type
{
    
}

- (void)initView
{
    self.view.backgroundColor = GlobalBgColor;
    self.logoImageView = [[UIImageView alloc]init];
    self.logoImageView.image = Image(@"tempAboutUs");
    self.logoImageView.layer.masksToBounds = YES;
    self.logoImageView.layer.cornerRadius = 85 / 2;
    [self.view addSubview:self.logoImageView];
    [self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.offset(35);
        make.size.mas_offset(CGSizeMake(85, 85));
    }];
    
    UILabel * versionLabel = [[UILabel alloc]init];
    [self.view addSubview:versionLabel];
    [versionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(10);
        make.centerX.equalTo(self.view);
    }];
    versionLabel.text = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
    
    
    self.contentLabel = [[UILabel alloc]init];
    self.contentLabel.numberOfLines = 0;
    [self.view addSubview:self.contentLabel];
    self.contentLabel.font = font(32);
    self.contentLabel.textAlignment = NSTextAlignmentLeft;
    self.contentLabel.textColor = ColorWithHexString(@"719da5");
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(versionLabel.mas_bottom).offset(35);
        make.left.offset(20);
        make.right.offset(-20);
    }];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
